let baseUrl = "http://localhost/H5-2003/vmall.com";//基础路径必须是绝对路径

define(['jquery'],function($){
    return{
        render:function(){
            let id = location.search.split("=")[1];
            // console.log(id);
            $.ajax({
                type: "get",
                url: `${baseUrl}/interface/model/getitem.php`,
                data: {
                    id:id
                },
                dataType: "json",
                success: function (res) {
                    // console.log(res);
                    let pic = JSON.parse(res.pic);
                    // console.log(pic);
                    let temp = `
                   
                    <div class="news">
                    <div class="news-title">
                        <a href="">首页&nbsp;&nbsp;></a>
                        <a href="">手机&nbsp;&nbsp;></a>
                        <a href="">HUAWEI nova系列&nbsp;&nbsp;></a>
                        <span class="title">${res.title}</span>
                    </div>
                    <div class="news-con">
                        <div class="news-con_f">
                            <div class="con_f_t">
                                <div class="smallpic">
                                    <img  class="smallpic_img" src="${baseUrl}/src/${pic[0].src}" alt="">
                                    <div class="movebox hide"></div>
                                </div>
                                <div class="moveimg">
                                    <ul>
                                        <li>
                                            <img src="${baseUrl}/src/${pic[1].src}" alt="">
                                            
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/${pic[2].src}" alt="">
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/${pic[3].src}" alt="">
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/${pic[4].src}" alt="">
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/${pic[4].src}" alt="">
                                        </li>
                                    </ul>
                                </div>
                            
                                <div class="big hide">
                                    <img src="${baseUrl}/src/${pic[0].src}" alt="" class="bigpic">
                                </div>
                            </div>
                         
                        </div>
                        <div class="news-con_r">
                            <div class="news_r_t">
                                <!-- 商品信息 -->
                                <div class="news_r_title">
                                    <h1>${res.title}</h1>
                                    <span>
                                        <a href="">①享3期免息②整点赠3e手环③限量赠薇姿化妆品礼包|以旧换新最高补贴1000，点击参与>>></a>
                                    </span>
                                    <p>
                                        麒麟985 5G SoC 旗舰级芯片；前置3200万像素高清自拍，后置6400万变焦四摄，前后双景录像； 新一代OLED极点全面屏；40W超级快充，4000mAh大电池
                                    </p>
                                </div>

                                <div class="news_r_jg">
                                    <span>
                                        <p>价&nbsp;&nbsp;&nbsp;&nbsp;格</p>
                                        <b>${res.price}</b>
                                    </span>
                                    <div class="news_r_jg_b">
                                        <p>促&nbsp;&nbsp;&nbsp;&nbsp;销</p>
                                        <div class="new_r_jg_con">
                                            <span>
                                                <a href="">赠品</a>
                                                <i>去选择 ></i>
                                            </span>
                                            <span>
                                                <a href="">一站式换新</a>
                                                <p>APP专享，最高补贴300元</p>
                                            </span>
                                            <span>
                                                <a href="">会员限量送</a>
                                                <p>V1及以上会员限量赠耳机</p>
                                            </span>
                                            <a href="">限量送</a>
                                            <a href="">分期免息</a>
                                            <a href="">赠送积分</a>
                                        </div>
                                        
                                    </div>
                                    
                                </div>
                                <div class="news_r_fw">
                                    <div class="news_r_fw_t">
                                        <p>服务说明</p>
                                        <span>
                                            <a href="">浙江 &nbsp;> &nbsp;杭州 &nbsp;>&nbsp;萧山</a>
                                        </span>
                                        <b>现货，今天21:59前付款，预计7月5日(周日)送达</b>
                                    </div>
                                    <div class="news_r_fw_b">
                                        <p>商品编码</p>
                                        <span>2601010207403</span>
                                    </div>
                                </div>
                                <div class="news_r_color">
                                    <p>选择颜色</p>
                                    <ul>
                                        <li>
                                            <img src="${baseUrl}/src/img/news13.png" alt="">
                                            <a href="">幻夜黑</a>
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/img/news14.png" alt="">
                                            <a href="">绿野仙踪</a>
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/img/news15.png" alt="">
                                            <a href="">钛空银</a>
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/img/news16.png" alt="">
                                            <a href="">霓影紫</a>
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/img/news17.png" alt="">
                                            <a href="">流光幻镜</a>
                                        </li>
                                        <li>
                                            <img src="${baseUrl}/src/img/news17.png" alt="">
                                            <a href="">流光幻镜</a>
                                        </li>
                                    </ul>
                                </div>
                                <div class="news_r_bb">
                                    <p>选择版本</p>
                                    <ul>
                                        <li>
                                            <!-- <img src="${baseUrl}/src/img/news13.png" alt=""> -->
                                            <a href="">Pro 8GB+128GB</a>
                                        </li>
                                        <li>
                                            <!-- <img src="${baseUrl}/src/img/news14.png" alt=""> -->
                                            <a href="">Pro 8GB+256GB</a>
                                        </li>
                                        <li>
                                            <!-- <img src="${baseUrl}/src/img/news15.png" alt=""> -->
                                            <a href="">Pro+ 8GB+256GB</a>
                                        </li>
                                        <li>
                                            <!-- <img src="${baseUrl}/src/img/news16.png" alt=""> -->
                                            <a href="">Pro+ 12GB+256GB</a>
                                        </li>
                                       
                                    </ul>
                                </div>
                                <div class="news_r_tc">
                                    <p>选择套餐</p>
                                    <span>
                                        <a href="">官方标配</a>
                                    </span>
                                </div>
                                <div class="news_r_spfw">
                                    <p>保障服务</p>
                                    <ul>
                                        <li>
                                            <a href="">碎屏(含后盖)服务宝1年&nbsp;&nbsp;￥239.2</a>
                                           
                                        </li>
                                        <li>
                                            <a href="">延长服务宝1年 &nbsp;&nbsp;￥168</a>
                                            
                                        </li>
                                    </ul>
                                </div>
                                <div class="news_r_fq">
                                    <p>分期免息</p>
                                    <ul>
                                        <li>
                                            <a href="">掌上生活分期&nbsp;∨</a>
                                        
                                        </li>
                                        <li>
                                           
                                            <a href="">花呗分期&nbsp; ∨</a>
                                          
                                        </li>
                                    </ul>
                                </div>
                                <div class="news_r_tj">
                                    <p>推荐</p>
                                    <ul>
                                        <li>
                                            <a href="">荣耀30</a>
                                        
                                        </li>
                                        <li>
                                           
                                            <a href="">荣耀30S</a>
                                          
                                        </li>
                                    </ul>
                                </div>
                                <div class="news_r_xz">
                                    <p>已选择商品:</p>
                                    <span>钛空银 / Pro 8GB+128GB / 官方标配 </span>
                                </div>
                                <div class="news_r_b">
                                    <div class="news_r_b_l">
                                        <input type="text">
                                        <p>
                                            <a href="">+</a>
                                            <a href="">-</a>
                                        </p>
                                    </div>
                                    <div class="news_r_b_r">
                                        <a href="./shoppin.html">加入购物车</a>
                                        <a href="">立即下单</a>
                                    </div>
                                </div>
                            </div>
                             
                         </div>
                    </div>
                </div>`;
                    
                    $('.news').html(temp);
                    fdj();
                   
                }
            });
            
        },
        
        addItem:function(){
           
        }
        
    };
    
   
});


